#include<iostream>
using std::cout;
using std::cin;
using std::endl;

struct Node
{
	int n;
	int * num;
	int sum;
	struct Node * next;
};
typedef struct Node Line;

int main(void)
{
	int m,i;
	Line * head = NULL;
	Line * tail = NULL;
	Line * temp = NULL;
	while( cin >> m )
	{
		temp = new Line;
		temp->next = NULL;
		temp->num = new int[m];
		temp->sum = 0;
		for( i=0;i<m;i++ )
		{
			cin >> temp->num[i];
			temp->sum += temp->num[i];
		}
		if (head == NULL)
		{
			head=temp;
			tail=temp;
		}
		else
		{
			tail->next = temp;
			tail = temp;
		}
	}
	while( head!=NULL )
	{
		cout << head->sum <<endl;
		delete [] head->num;
		temp = head;
		head = head->next;
		delete temp;
	}
	return 0;
}